/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeleteTaller1BMData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = bmacotada.orm.Taller1BMPersistentManager.instance().getSession().beginTransaction();
		try {
			bmacotada.orm.DAOFactory lDAOFactory = bmacotada.orm.DAOFactory.getDAOFactory();
			bmacotada.orm.dao.Paciente_1DAO bMAcotadaormPaciente_1DAO = lDAOFactory.getPaciente_1DAO();
			bmacotada.orm.Paciente_1 bMAcotadaormPaciente_1 = bMAcotadaormPaciente_1DAO.loadPaciente_1ByQuery(null, null);
			// Delete the persistent object
			bMAcotadaormPaciente_1DAO.delete(bMAcotadaormPaciente_1);
			bmacotada.orm.dao.Pregunta_1DAO bMAcotadaormPregunta_1DAO = lDAOFactory.getPregunta_1DAO();
			bmacotada.orm.Pregunta_1 bMAcotadaormPregunta_1 = bMAcotadaormPregunta_1DAO.loadPregunta_1ByQuery(null, null);
			// Delete the persistent object
			bMAcotadaormPregunta_1DAO.delete(bMAcotadaormPregunta_1);
			bmacotada.orm.dao.Respuesta_1DAO bMAcotadaormRespuesta_1DAO = lDAOFactory.getRespuesta_1DAO();
			bmacotada.orm.Respuesta_1 bMAcotadaormRespuesta_1 = bMAcotadaormRespuesta_1DAO.loadRespuesta_1ByQuery(null, null);
			// Delete the persistent object
			bMAcotadaormRespuesta_1DAO.delete(bMAcotadaormRespuesta_1);
			bmacotada.orm.dao.Cuestionario_1DAO bMAcotadaormCuestionario_1DAO = lDAOFactory.getCuestionario_1DAO();
			bmacotada.orm.Cuestionario_1 bMAcotadaormCuestionario_1 = bMAcotadaormCuestionario_1DAO.loadCuestionario_1ByQuery(null, null);
			// Delete the persistent object
			bMAcotadaormCuestionario_1DAO.delete(bMAcotadaormCuestionario_1);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteTaller1BMData deleteTaller1BMData = new DeleteTaller1BMData();
			try {
				deleteTaller1BMData.deleteTestData();
			}
			finally {
				bmacotada.orm.Taller1BMPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
